import request from '@/utils/request'

//对接微信发货
export function sendByWx(data) {
  return request({
    url: '/dispatchList/sendByWx',
    method: 'post',
    data: data
  })
}

// 查询订单明细列表
export function listList(query) {
  return request({
    // url: '/system/order-list/list',
    url: '/dispatchList/list',
    method: 'get',
    params: query
  })
}

//发货
export function deliverGoods(data) {
  return request({
    url: '/dispatchList/send',
    method: 'post',
    data: data
  })
}

export function listList_old(query) {
  return request({
    url: '/system/order-list/list',
    // url: '/system/order-list/newlist',
    method: 'get',
    params: query
  })
}

// 查询订单明细详细
export function getList(id) {
  return request({
    url: '/system/order-list/' + id,
    method: 'get'
  })
}

// 新增订单明细
export function addList(data) {
  return request({
    url: '/system/order-list',
    method: 'post',
    data: data
  })
}

// 修改订单明细
export function updateList(data) {
  return request({
    url: '/system/order-list',
    method: 'put',
    data: data
  })
}

// 删除订单明细
export function delList(id) {
  return request({
    url: '/system/order-list/' + id,
    method: 'delete'
  })
}

export function delUserBagOrderList(id,source) {
  return request({
    url: '/system/my-user/bag?id=' + id+'&source='+source,
    method: 'delete'
  })
}

export function returnGoods(param) {
  return request({
    url: '/dispatchList/returnGoods',
    data: param,
    method: 'post'
  })

}
